﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ManagerJobType.aspx.cs" Inherits="Admin_Job_JobTypeManager" %>

<%@ Register Src="~/Control/PageNo.ascx" TagName="PageNo" TagPrefix="uc1" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>职位类别管理</title>
    <link rel="stylesheet" href="../skin/style.css" type="text/css" />

    <script type="text/javascript" src="../../js/jquery.js"></script>

    <script type="text/javascript">   
    function checkbox(){
        // 找到所有的 input 元素
        var ctllist = window.document.form1.getElementsByTagName("input");
        var chec=false;             
        for( var i = 0; i< ctllist.length; i++){
            if( ctllist[i].type == "checkbox" && ctllist[i].name.indexOf( "CheckBox1") >=0){
                if(ctllist[i].checked==true){
                    chec=true;  
                }
            }           
        }
        if(chec==false){
            alert("请至少选择一项");
            return false;
        }else 
        {
           return confirm("确定要删除吗？");
        }    
    } 
    function check(){
        if(document.getElementById("txtTypeName").value=="" || document.getElementById("txtTypeName").value==null)
                document.getElementById("message").innerHTML="<font color='red'>请输入类别名称</font>";
                return false;
    }       
    </script>

</head>
<body>
    <form id="form1" runat="server">
        <div class="itemtitle">
            <h3>
                操作提示</h3>
        </div>
        <div class="itemtitle_tect">
            <ul>
                <li>通过职位类别管理，您可以进行编辑和删除等操作；</li>
            </ul>
        </div>
        <div class="clr">
        </div>
        <asp:Panel ID="pnlArea" runat="server" Visible="False">
            <div class="itemtitle">
                <h3>
                    添加分类</h3>
            </div>
            <div class="itemtitle_tect">
                <p>
                    上级类别：
                    <asp:DropDownList ID="FIDList" runat="server">
                    </asp:DropDownList>
                    类别名称：
                    <asp:TextBox ID="txtTypeName" runat="server"></asp:TextBox></span>
                    <asp:Button ID="btnInsert" runat="server" OnClick="btnInsert_Click" Text="添加" CssClass="i_button" />
                    <asp:Button ID="btnReturn" runat="server" OnClick="btnReturn_Click" Text="取消" CssClass="i_button" />
                    <asp:Label
                        ID="lblMessage" runat="server" Width="300px" ForeColor="red"></asp:Label><span id="message">
                    <asp:Label ID="lblError" runat="server" ForeColor="red"></asp:Label>
                </p>
            </div>
        </asp:Panel>
        <div class="partition">
            <div class="Option">
                <asp:Label ID="Label5" runat="server"><strong>快捷操作</strong></asp:Label>
                <span>
                    <asp:LinkButton ID="LinkButton1" runat="server" OnClick="LinkButton1_Click">添加类别</asp:LinkButton>
                </span>
            </div>
            <div class="search">
                类别名称：
                <asp:TextBox ID="txtName" runat="server" Width="130"></asp:TextBox>
                <asp:Button ID="btnSearch" runat="server" CssClass="i_button" OnClick="btnSearch_Click"
                    Text="立即查询" />
            </div>
        </div>
        <div class="talbe_border ">
            <div class="head_ling">
                职位类别管理</div>
            <asp:DataList ID="dlstProType" runat="server" DataKeyField="ID" OnCancelCommand="dlstProType_CancelCommand"
                OnDeleteCommand="dlstProType_DeleteCommand" OnEditCommand="dlstProType_EditCommand"
                OnUpdateCommand="dlstProType_UpdateCommand" RepeatColumns="3" CellPadding="0"
                CssClass="talbe_list" Width="100%">
                <HeaderStyle CssClass="noya" />
                <HeaderTemplate>
                    <tr onmouseover="this.style.backgroundColor='#F0F7FD'" onmouseout="this.style.backgroundColor=''">
                        <td>
                            选项
                        </td>
                        <td>
                            职位类别
                        </td>
                        <td>
                            添加时间
                        </td>
                        <td>
                            操作选项
                        </td>
                    </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr onmouseover="this.style.backgroundColor='#F0F7FD'" onmouseout="this.style.backgroundColor=''">
                        <td>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </td>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "TypeName")%>
                        </td>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "AddDate")%>
                        </td>
                        <td>
                            <asp:LinkButton ID="lbtnEdit" runat="server" CommandName="edit">编辑</asp:LinkButton>|
                            <asp:LinkButton ID="lbtnDelete" runat="server" CommandName="delete" OnClientClick="return confirm('你确定要删除吗?')"
                                Text="删除"></asp:LinkButton>
                        </td>
                    </tr>
                </ItemTemplate>
                <EditItemTemplate>
                    <tr>
                        <td>
                            <asp:CheckBox ID="CheckBox1" runat="server" />
                        </td>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" Text='<%# Eval("TypeName")%>' Width="80"></asp:TextBox>
                        </td>
                        <td>
                            <%# DataBinder.Eval(Container.DataItem, "AddDate")%>
                        </td>
                        <td>
                            <asp:LinkButton ID="LinkButton1" runat="server" CommandName="update">更新</asp:LinkButton>
                            <asp:LinkButton ID="LinkButton2" runat="server" CommandName="cancel">取消</asp:LinkButton>
                        </td>
                    </tr>
                </EditItemTemplate>
            </asp:DataList>
            <div class="Paging">
                <p>
                    <uc1:PageNo ID="PageNo1" runat="server" />
                </p>
                <input id="CheckBox2" name="CheckBox2" onclick="SelectAll();" type="checkbox" />全选
                <asp:Button ID="btnDelete" runat="server" OnClientClick="return checkbox();" Text="批量删除"
                    CssClass="i_button" OnClick="btnDelete_Click1" />
            </div>
        </div>
    </form>
</body>
</html>
